<extend name="Base/common"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>行为日志&nbsp;&nbsp;&nbsp;<sub style="color: red">行为日志长期积累会导致整个系统性能下降，请定时清理</sub></h2>
	</div>
    <div class="clearfix">
        <div class="col-xs-8">
            <button class="btn ajax-get confirm" url="{:U('clear')}">清 空</button>
            <button class="btn ajax-post confirm" target-form="ids" url="{:U('remove')}">删 除</button>
        </div>

        <div class="col-xs-4">
            <div class="search-form  pull-right">
                <div class="input-group" style="width: 200px" >
                    <input type="text" name="uid" class="search-input form-control" value="{:I('get.uid','','intval')}" placeholder="请输入用户UID">
                    <span class="input-group-btn">
                        <a class="btn btn-default" href="javascript:;" id="search" url="{:U('Action/actionlog')}">
                            <i class="icon-search"></i>
                        </a>
                    </span>
                </div>
            </div>
        </div>
    </div>

	<!-- 数据列表 -->
	<div class="data-table with-padding">
    	<table class="table table-bordered table-striped ">
            <thead>
                <tr>
        		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        		<th class="">序号</th>
        		<th class="">行为名称</th>
        		<th class="">执行者</th>
                <th class="">日志内容</th>
        		<th class="">执行时间</th>
        		<th class="">操作</th>
        		</tr>
            </thead>
            <tbody>
        		<notempty name="_list">
            		<volist name="_list" id="vo">
                		<tr>
                            <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                			<td>{$vo.id} </td>
                			<td>{:get_action($vo['action_id'],'title')}</td>
                			<td><a href="{:U('Action/actionlog',array('uid'=>$vo['user_id']))}">{:get_nickname($vo['user_id'])}</a></td>
                            <td>{$vo.remark}</td>
                			<td><span>{$vo.create_time|time_format}</span></td>
                			<td><a class="confirm ajax-get" href="{:U('Action/remove?ids='.$vo['id'])}">删除</a></td>
                		</tr>
            		</volist>
        		<else/>
                    <td colspan="7" class="text-center"> aOh! 暂时还没有内容！ </td>
        		</notempty>
        	</tbody>
        </table>
	</div>
	<!-- 分页 -->
	<div class="with-padding">{$_page}</div>
	<!-- /分页-->

</block>
<block name="js">
<script type="text/javascript">
    $(function(){
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });

        $("#action_add").click(function(){
    		window.location.href = $(this).attr('url');
    	});
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
    })
</script>
</block>
